#include <iostream>

using namespace std;
/**
 * 继承：is-a
 */
class Person
{
public:
    Person()
    {

    }

    Person(string name, int id) : m_name(name), m_id(id)
    {

    }

    void eat()
    {
        cout << "eat 2" << endl;
    }

    void sleep()
    {
        cout << "sleep" << endl;
    }

    void work()
    {
        cout << "work" << endl;
    }

    string m_name;
    int m_id;
};

class Zhangsan : public Person
{
public: 
    Zhangsan(string name, int id) : Person(name, id)
    {

    }
};

int main(int argc, char **argv)
{
    Zhangsan z("zhangsan", 14);
    cout << sizeof(z) << endl;
    z.eat();
    z.sleep();
    z.work();

    cout << z.m_name << endl;
    cout << z.m_id << endl;
    
    return 0;
}